package data.combinations;

import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.ArrayList;

import data.enums.Continent;
import data.enums.Index;

/**
 * Use this class to create other combinations with the indexes like two indexes by continent for example. 
 * 
 * All methods of this class must be return a Set<List<Index>. It's important that the enclosure Collections is  List because the order is important.
 * The first item of the List must be an american index, then asian and europe.
 */
public class IndexesCombinations {

	public static Set<List<Index>> getOneIndexByContinent() { 

		Set<List<Index>> result = new HashSet<>();
		
		for (Index americanIndex : Continent.AMERICA.getIndexes()) {
			
			for (Index asianIndex : Continent.ASIA.getIndexes()) {
				
				for (Index europeanIndex : Continent.EUROPE.getIndexes()) {
					
					List<Index> oneByContinent = new ArrayList<>(Arrays.asList(americanIndex, asianIndex, europeanIndex));
					result.add(oneByContinent);
					
				}
			}
		}
		
		return result;

	}

}
